flight-cli: decompose cli.py monolith (safe pass) + unify the weaves (work-ai0jn.1/.2)#33
Open
ak2k wants to merge 9 commits into
Open
flight-cli: decompose cli.py monolith (safe pass) + unify the weaves (work-ai0jn.1/.2)#33ak2k wants to merge 9 commits into
ak2k wants to merge 9 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Decomposes the 3,172-LOC
cli.pymonolith into 7 focused modules (safe pass — behavior-preserving) and unifies the two GF+Matrix concurrent weaves, closing the search-weave isolation gap. Closeswork-ai0jn.1; delivers phase 1 ofwork-ai0jn.2.What changed
cli.py:_console,_parsing,_runtime_opts,_dispatch,_urls,_pp_glue,_render(the big one, 500 LOC).cli.py3,172 → 1,975 LOC. The weaves, orchestration, and command defs stay incli.py(deferred to phase 2).work-ai0jn.1) — a shared_matrix_into_statedual-catch helper (MatrixApiError → matrix_err;Exception → matrix_unexpected) that both weaves route through, closing the search weave's non-MatrixApiErrorisolation gap (a raw transport error could previously escape the task group, cancel the GF paint, and traceback). Search post-run now reportsmatrix_unexpected, mirroring the calendar path.Behavior preservation
make checkgreen after each (ruff +ruff format --check+ basedpyright strict + pytest).test_search_weave.py) that would traceback against the pre-fix code.flight airport+ the fullflight search JFK LHRpath (GF table → …refining with Matrix… → merged GF+Matrix repaint) render identically tomain.Convention (documented
# DIVERGE)Extracted modules expose public names;
cli.pyre-imports them under underscore aliases (from ._render import render_search as _render_search) soflight_cli.cli.Xstays resolvable for the test suite's imports +monkeypatch.setattr(cli, …). This is a suppression-free convention matching the repo's existingmerge as _merge_cabinspattern; it converges in phase 2 (once orchestration leavescli.py, tests patch the submodules directly per the_gf_dategrid/_calendar_splitprecedent).Review
ce-code-review (correctness · architecture · maintainability · project-standards): correctness clean; all other findings P2/P3, deferred to phase 2 and tracked on
work-ai0jn.2— shim→submodule convergence,_run_*→_orchestrate.pyas the next seam, and a typed weave-outcome object.